using Microsoft.OpenApi.Models;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddRouting(opt => { opt.LowercaseUrls = true; });
builder.Services.AddSwaggerGen(c =>
{
    c.SwaggerDoc("v1", new OpenApiInfo { Title = "基于内存的缓存", Version = "v1.0.0", 
        Description = "MemoryCache" });
    var file = Path.Combine(AppContext.BaseDirectory, "MemoryCache.xml");
    var path = Path.Combine(AppContext.BaseDirectory, file);
    c.IncludeXmlComments(path, true);
});

var app = builder.Build();
app.UseSwagger();
app.UseSwaggerUI();
app.UseAuthorization();
app.UseAuthorization();
app.MapControllers();
app.Run();